#!/bin/bash

# 永久设置wxWidgets路径到环境变量
WXWIN="/d/vc/wxWidgets-3.2.7"

echo "🔧 永久设置wxWidgets环境变量..."

# 检查bash配置文件
if [ -f ~/.bashrc ]; then
    if ! grep -q "wxWidgets" ~/.bashrc; then
        echo "# wxWidgets路径" >> ~/.bashrc
        echo "export WXWIN=\"$WXWIN\"" >> ~/.bashrc
        echo "export PATH=\"\$WXWIN/lib:\$PATH\"" >> ~/.bashrc
        echo "✅ 已添加到 ~/.bashrc"
    else
        echo "✅ wxWidgets路径已在 ~/.bashrc 中"
    fi
fi

if [ -f ~/.bash_profile ]; then
    if ! grep -q "wxWidgets" ~/.bash_profile; then
        echo "# wxWidgets路径" >> ~/.bash_profile
        echo "export WXWIN=\"$WXWIN\"" >> ~/.bash_profile
        echo "export PATH=\"\$WXWIN/lib:\$PATH\"" >> ~/.bash_profile
        echo "✅ 已添加到 ~/.bash_profile"
    else
        echo "✅ wxWidgets路径已在 ~/.bash_profile 中"
    fi
fi

echo ""
echo "🎉 环境变量设置完成！"
echo "💡 重新启动终端或运行: source ~/.bashrc"
